package com.gss.module.generator.constants;

/**
 * @author DYang
 * @date 2023/5/25
 * 模板枚举信息
 */
public enum TemplateEnum {
    DEFAULT_NULL("DEFAULT_NULL","默认null值"),
    AUTHOR("AUTHOR","作者信息"),
    DATE("DATE","当前日期"),
    SCOPE("SCOPE","作用域"),
    ENTITY_NAME("ENTITY_NAME","实体类名称"),
    ENTITY_DESC("ENTITY_DESC","实体类描述"),
    TABLE_NAME("TABLE_NAME","映射表名称"),
    CLASS_NAME("CLASS_NAME","类名称"),
    CLASS_FIELDS_INFO("CLASS_FIELDS_INFO","类中字段占位符号"),
    PARENT_DEPENDENCY("PARENT_DEPENDENCY","父级依赖"),
    GROUP_ID("GROUP_ID","分组id"),
    ARTIFACT_ID("ARTIFACT_ID","坐标id"),
    DEPENDENCY_VERSION("DEPENDENCY_VERSION","依赖版本"),
    DEPENDENCY_MANAGEMENT("DEPENDENCY_MANAGEMENT","依赖管理"),
    DEPENDENCIES("DEPENDENCIES","依赖坐标"),
    BOOLEAN("Boolean","布尔类型"),
    INTEGER("Integer","int包装类型"),
    FLOAT("Float","float包装类型"),
    DOUBLE("Double","double包装类型"),
    LONG("Long","long包装类型"),
    CHAR("char","char类型"),
    BYTE("Byte","byte包装类型"),
    SHORT("Short","short包装类型"),
    STRING("String","String类型"),
    PUBLIC("public","public作用域"),
    PROTECTED("protected","protected作用域"),
    PRIVATE("private","private作用域"),
    DEFAULT_SCOPE("","默认作用域"),
    ROUTE_NAME("ROUTE_NAME","controller路由地址"),
    ;

    private  String name;
    private  String desc;

    TemplateEnum(String name, String desc) {
        this.name = name;
        this.desc = desc;
    }

    public String getName() {
        return name;
    }

    public String getDesc() {
        return desc;
    }

    public static TemplateEnum getTemplateEnum(String name){
        if (name == null) {
            return DEFAULT_NULL;
        }
        TemplateEnum[] values = values();
        for (TemplateEnum value : values) {
            if (value.name.equals(name)) {
                return value;
            }
        }
        return DEFAULT_NULL;
    }
}
